package cn.edu.sdjzu.xg.eagle;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import cn.edu.sdjzu.xg.eagle.Pagination;
import cn.edu.sdjzu.xg.eagle.TxtHelper;

import java.io.IOException;

public class JosnTest1 {
    public static void main(String args[])throws IOException {
          String json_obj_str = TxtHelper.readTxt("files/"+"paginationObject.txt");
          JSONObject pagination_json_obj = JSON.parseObject(json_obj_str);

          Object pageSize_obj = pagination_json_obj.get("pageSize");
          Object pageNo_obj = pagination_json_obj.get("pageNo");

          Pagination pagination2 = JSON.parseObject(json_obj_str,Pagination.class);
          int pageNo2 = pagination2.getPageNo();
          int pageSize2 = pagination2.getPageSize();

          System.out.println(pageNo2);
          System.out.println(pageSize2);
    }
}
